import * as THREE from "../../../../modules/three/three.module.js";
import {assets3dBaseUrl} from "../CommonConsts.js";
import {flatten} from "../util/StaticMethods.js";

const droneIcon = new THREE.TextureLoader().load( assets3dBaseUrl + 'texture/droneIcon.png' );

export default class DroneIconPoint extends THREE.Points {
  pointMtl = new THREE.PointsMaterial( {
    size: 64,
    color: "#fff",
    sizeAttenuation: false,
    map: droneIcon,
    alphaTest: 0.5,
    toneMapped: false,
    transparent: true } )

  constructor() {
    super()
    this.material = this.pointMtl
    const pointGeo = new THREE.BufferGeometry();
    pointGeo.setAttribute('position', new THREE.BufferAttribute(flatten([new THREE.Vector3(0, 0, 0)]), 3));
    this.geometry = pointGeo;
  }
}
